package com.hanamaki.oop.demo11;

import com.hanamaki.oop.demo11.Car;

// 客车类 去继承 父类
public class BusCar extends Car {

    //    子类中 实现自己特有的方法 来判断 座位  得到实际的日租价

    /**
     *  判断日租费
     * @param seat
     */
    public void isRendDay(int seat) {
        if (seat <= 16) {
            super.seat = seat;
            super.dayRendMoney = 800;
        } else if (seat > 16) {
            super.seat = seat;
            super.dayRendMoney = 1500;
        }

    }

    @Override
    public void calcRendPrice(int days) {
        System.out.println("车座位数为：" + super.seat + ";\n" +
                "日租费为：" + super.dayRendMoney + ";\n" +
                "租赁天数为：" + days + ";\n" +
                "租赁价为：" + days * super.dayRendMoney);
    }

}
